function print(columns, orders){
	
	var LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
	LODOP.PRINT_INIT("打印报表");
	LODOP.SET_PRINT_PAGESIZE(0,2100,2970,"A4"); 
	
	LODOP.ADD_PRINT_HTM(10,10,'95%','95%',createData(columns, orders));
	
	LODOP.PREVIEW();
}

function exportExcel(columns, orders) {
	
	var LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));
	LODOP.PRINT_INIT("导出xls文件");
	
	LODOP.ADD_PRINT_TABLE(10,10,'90%','90%',createData(columns, orders));
	
	var date = new Date();
	LODOP.SAVE_TO_FILE(date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate()+"出入库.xlsx");
}

function createData(columns, orders) {
	var div = jQuery("<div></div>");
	var table = jQuery("<table border='1' cellpadding='1' cellspacing='0' bordercolor=#000 style='position:absolute;left:0px;top:0px;border-collapse:collapse;font-size:15px;table-layout:fixed;'></table>").appendTo(div);
	var thead = jQuery("<thead></thead>").appendTo(table);
	var tr = jQuery("<tr height='30px'></tr>").appendTo(thead);
	for(var i=0;i<columns.length;i++){
		if (columns[i].width) {
			var th = jQuery("<th width=" + columns[i].width + "></th>").appendTo(tr);
			th.html(columns[i].value);
		}else {
			var th = jQuery("<th></th>").appendTo(tr);
			th.html(columns[i].value);
		}
		
	}
	
	for(var i=0;i<orders.length;i++){
		var tr2 = jQuery("<tr height='25px'></tr>").appendTo(table);
		for(var j=0;j<columns.length;j++){
			var td = jQuery("<td style='text-align:center;'></td>").appendTo(tr2)
			td.html(orders[i][columns[j].name]);
		}  	    	
	} 
	
	return div.html();
}